package com.xiaoq.sites.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.xiaoq.apis.order.IUserCouponApi;
import com.xiaoq.apis.sites.IMerchantApi;
import com.xiaoq.sites.entity.MerchantEntity;
import com.xiaoq.sites.repository.IMerchantRepository;

@Service(interfaceClass=IMerchantApi.class, version="1.0.0")
public class MerchantDubboService implements IMerchantApi {
	
	@Autowired
	private IMerchantRepository merchantRep;

	@Override
	public String getMerchantStatus(String merchantId) {
		if(StringUtils.isNotEmpty(merchantId)){
			MerchantEntity merchant = merchantRep.findById(merchantId);
			String status = null;
			if(merchant!=null){
				status = merchant.getStatus();
			}
			return status;
		}
		
		return null;
		
	}

}
